<?php
class TemplateType {
	const TEMPLATE_CHIEF_COMPLAINTS = 1;
	const TEMPLATE_PRESCRIPTION 	= 2;
	const TEMPLATE_DIAGNOSIS 		= 3;
	const TEMPLATE_INVESTIGATION 	= 4;
	const TEMPLATE_REMARK 			= 5;
}

class DepartmentType {
	const DEPARTMENT_RECEPTION 		= 1;
	const DEPARTMENT_OPD 			= 2;
	const DEPARTMENT_LAB 			= 3;
	const DEPARTMENT_IPD 			= 4;
	const DEPARTMENT_BILLING 		= 5;
}

class PatientType {
	const PATIENT_CB					= 1;
	const PATIENT_SENIOR_CITIZEN 		= 2;
	const PATIENT_GENERAL 				= 3;
	const PATIENT_BELOW_POVERTY_LINE 	= 4;
	
	const PATIENT_GENDER_MALE			= 1;
	const PATIENT_GENDER_FEMALE			= 2;
	const PATIENT_GENDER_CHILDREN		= 3;
	
	public static function getPatientTypeNameById( $intPatientTypeId ) {
		$strPatientTypeName = '';
		switch( $intPatientTypeId ) {
			case 1:
				$strPatientTypeName = 'CB';
				break;
				
			case 2:
				$strPatientTypeName = 'Senior Citizen';
				break;
				
			case 3:
				$strPatientTypeName = 'Genetal';
				break;
				
			case 4:
				$strPatientTypeName = 'Below Poverty Line';
				break;
			
			default:
				break;
		}
		
		return $strPatientTypeName;
	}
	
	public static function getPatientAreaNameById( $intPatientAreaId) {
		$strPatientAreaName = '';
		switch( $intPatientAreaId ) {
			case 1:
				$strPatientAreaName = 'CB Area';
				break;
	
			case 2:
				$strPatientAreaName = 'Out Of CB Area';
				break;
	
			default:
				break;
		}
	
		return $strPatientAreaName;
	}
	
	public static function getGenderNameById( $intGenderId ) {
		$strGenderName = '';
		switch( $intGenderId ) {
			case 1:
				$strGenderName = 'Male';
				break;
				
			case 2:
				$strGenderName = 'Female';
				break;
				
			case 3:
				$strGenderName = 'Other';
				break;
				
			default:
				$strGenderName = '';
				break;
		}
		
		return $strGenderName;
	}
	
	public static function getPatientByWardCatagory( $objPatient, $objWardCatagory ) {
		
		if( false == valObj( $objPatient, 'BasePatients' ) || false == valObj( $objWardCatagory, 'BaseWardCatagories' ) ) return NULL;
		
		$strSelected = NULL;
		
		if( PatientType::PATIENT_GENDER_MALE == $objPatient->getGender() && $objWardCatagory->getId() == $objPatient->getGender() ) {
			$strSelected = 'selected="selected"';
		} elseif( PatientType::PATIENT_GENDER_FEMALE == $objPatient->getGender() && $objWardCatagory->getId() == $objPatient->getGender() ) {
			$strSelected = 'selected="selected"';
		} elseif( ( PatientType::PATIENT_GENDER_FEMALE == $objPatient->getGender() || PatientType::PATIENT_GENDER_MALE == $objPatient->getGender() ) && $objWardCatagory->getId() == $objPatient->getGender() && $objPatient->getAge() < 18 ) {
			$strSelected = 'selected="selected"';
		}
		
		return $strSelected;
	}
	
	public static function getRateByPatientType( $objPatient, $intChargeAmount ) {
		if( false == valObj( $objPatient, 'BasePatients' ) || 0 <= $intChargeAmount ) return 0;

		$intCalculatedAmount = 0;
		
		switch( $objPatient->getPatientTypeId() ) {
			case 1:
				$intCalculatedAmount = 0;
				break;
				
			case 2:
				$intCalculatedAmount = 0;
				break;
			
			case 3:
				$intCalculatedAmount = $intChargeAmount;
				break;
				
			case 4:
				$intCalculatedAmount = $intChargeAmount / 2;
				break;
				
			default:
				break;
		}
		
		return $intCalculatedAmount;
	}
}

class ChargeCatagoriesType {
	const CHARGE_CATAGORY_REGISTRATION = 1;
	const CHARGE_CATAGORY_OPD = 2;
	const CHARGE_CATAGORY_IPD = 3;
	const CHARGE_CATAGORY_WARD = 4;
	const CHARGE_CATAGORY_ROOM = 5;
	const CHARGE_CATAGORY_LAB = 6;
}
?>